using System.Buffers;

namespace Letter.IO.Buf;

public static class BufferProvider
{
    public static IBuffer<T> Create<T>()
    {
        return Create(BufferOptions<T>.Default);
    }

    public static IBuffer<T> Create<T>(MemoryPool<T> memoryPool)
    {
        return Create(new BufferOptions<T>(pool: memoryPool));
    }

    public static IBuffer<T> Create<T>(BufferOptions<T> options)
    {
        return new Buffer<T>(options);
    }
}